#ifndef __OBJECT_OBJ_STRING_H__

#define __OBJECT_OBJ_STRING_H__

/**
 * @file obj_string.h
 * @author your name (you@domain.com)
 * @brief 字符串对象
 * @version 0.1
 * @date 2022-07-02
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#include "header_obj.h"

typedef struct {
    ObjHeader objHeader;
    uint32_t  hashCode; // 字符串的哈希值
    CharValue value;
} ObjString;

uint32_t hashString(char *str, uint32_t length);
void hashObjString(ObjString *objString);
ObjString* newObjString(VM *vm, const char *str, uint32_t length);

#endif